{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% block title %}{{ user.username }}的博文{% endblock %}

{% block page_content %}

    <div class="row">
        <h1 class="text-center">{{ user.username }}的博文</h1>
        <div class="col-lg-9">
            {% for post in posts %}
                <div class="row">
                    <div class="col-lg-12"><h1>{{ post.title }}</h1></div>
                </div>
                <div class="row">
                    <div class="col-lg-12">
                        {{ post.text | truncate(500) | safe }}
                        <a href="{{ url_for('post_bpn.post', post_id=post.id) }}">阅读全文</a>
                    </div>
                </div>
            {% endfor %}
        </div>
        <div class="col-lg-3">
            <div class="row">
                <h5>最新博文</h5>
                <ul>
                    {% for post in recent %}
                        <li><a href="{{ url_for('post_bpn.post', post_id=post.id) }}">{{ post.title }}</a></li>
                    {% endfor %}
                </ul>
            </div>
            <div class="row">
                <h5>常用标签</h5>
                <ul>
                    {% for tag in top_tags %}
                        <li><a href="{{ url_for('post_bpn.tag', tag_name=tag[0].title) }}">{{ tag[0].title }}</a></li>
                    {% endfor %}
                </ul>
            </div>
        </div>

{% endblock %}